
public class ProxyStock extends Stock {

	public Stock stock;
	private String ticker;
	private float price;
	private float change;
	private String chartUrl;
	private long lastUpdated;
	private String name;
	private float changePercent;
	public ProxyStock(String ticker) { 

		this.ticker = ticker; 
	}

	private void load(){
		if (stock == null) {
			stock = new RealStock(); 
		}

		stock = RealStock.getInstans().getStockInformation(ticker);
	}
	
	public Stock getStockObj(){
		load();
		System.out.println("Loading..." + ticker);
		return stock;
	}

	public String getName() {
		load();
		return name;
	}

	public String getTicker() {
		load();
		return ticker;
	}


	public float getPrice() {
		load();
		return price;
	}


	public float getChange() {
		load();
		return change;
	}

	public float getChangePercent() {
		load();
		return changePercent;
	}
	
	public String getChartUrl() {
		load();
		return chartUrl;
	}


	public long getLastUpdated() {
		load();
		return lastUpdated;
	}



}
